from django.db import models


# Create your models here.
class LeaveLog(models.Model):
    classname = models.CharField(verbose_name='班级名', max_length=255)
    name = models.CharField(verbose_name='姓名', max_length=255)
    phone = models.CharField(verbose_name='联系电话', max_length=11)
    go_place = models.CharField(verbose_name='去向', max_length=255)
    description = models.TextField(verbose_name='描述', max_length=255, null=True, blank=True, )
    status = models.IntegerField(verbose_name='状态', default=0, null=True, blank=True,
                                 choices=((-1, '驳回'), (0, '待处理'), (1, '通过'), (2, '已销假')))

    operator = models.CharField(verbose_name='审核人', max_length=255, null=False, blank=True)
    rejection = models.CharField(verbose_name='驳回提示', max_length=255, null=False, blank=True)
    create_time = models.DateTimeField(verbose_name='创建时间', auto_now_add=True)
    return_time = models.DateTimeField(verbose_name='销假时间', null=True, blank=True)

    class Meta:
        verbose_name = '请假登记'
        verbose_name_plural = verbose_name

    def __str__(self):
        return '【' + self.classname + '】' + self.name
